package com.tcm.service;

import com.tcm.entity.Exercise;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tcm.entity.ExerciseStudent;
import com.tcm.entity.dto.ExercisePublishDto;
import com.tcm.entity.dto.param.ExercisePublishPageParam;
import com.tcm.entity.resp.PageR;
import com.tcm.entity.vo.ExerciseStuResult;
import com.tcm.entity.vo.ExerciseStudentStatusResult;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
* @author Guqier
* @description 针对表【ts_exercise(实训练习表)】的数据库操作Service
* @createDate 2023-08-10 21:22:50
*/
public interface ExerciseService extends IService<Exercise> {

    @Transactional
    boolean publishExercise(ExercisePublishDto dto, Long currUserId);

    @Transactional
    boolean canselPublishExercise(Long id);

    PageR<ExercisePublishDto> getPublishExerciseListByPage(ExercisePublishPageParam param, Long currUserId);

    List<ExerciseStuResult> getStuExerciseList(Long currUserId);

    List<ExerciseStudentStatusResult> getStudentCompletionStatusList(Long id);

    ExerciseStudent getExerciseStudent(Long exerciseId, String account);

    boolean completeExercise(Long exerciseId, String account);
}
